import { BasicColumn, BasicTable, FormSchema, useTable } from "@/components/Table";
import { useTranslation } from "react-i18next";

export default function index() {
	const { t } = useTranslation();
	const searchFormSchema: FormSchema[] = [
		{
			label: t("kevin_ui.from_date"),
			field: "from_date",
			component: "DatePicker"
		},
		{
			label: t("kevin_ui.to_date"),
			field: "to_date",
			component: "DatePicker"
		},
		{
			label: t("patientBasic.patient_id"),
			field: "patientId",
			component: "Select"
		},
		{
			label: t("patientBasic.full_name"),
			field: "fullName",
			component: "Select"
		},
		{
			label: t("patientBasic.birthyear"),
			field: "birthday",
			component: "Select"
		},
		{
			label: t("patientBasic.pat_type"),
			field: "patType",
			component: "Select"
		},
		{
			label: t("patientBasic.age"),
			field: "age",
			component: "Select"
		},
		{
			label: t("patientBasic.gender"),
			field: "gender",
			component: "Select"
		},
		{
			label: t("patientBasic.pat_address"),
			field: "address",
			component: "Select"
		},
		{
			label: t("patientBasic.occupation"),
			field: "occupation",
			component: "Select"
		},
		{
			label: t("patientBasic.ethnicity"),
			field: "ethnicity",
			component: "Select"
		}
	];
	const columns: BasicColumn[] = [
		{
			title: t("patientBasic.patient_id"),
			dataIndex: "patientId"
		},
		{
			title: t("patientBasic.full_name"),
			dataIndex: "fullName"
		},
		{
			title: t("patientBasic.birthyear"),
			dataIndex: "birthday"
		},
		{
			title: t("patientBasic.pat_type"),
			dataIndex: "patType"
		},
		{
			title: t("patientBasic.age"),
			dataIndex: "age"
		},
		{
			title: t("patientBasic.gender"),
			dataIndex: "gender"
		},
		{
			title: t("patientBasic.pat_address"),
			dataIndex: "address"
		},
		{
			title: t("patientBasic.occupation"),
			dataIndex: "occupation"
		},
		{
			title: t("patientBasic.ethnicity"),
			dataIndex: "ethnicity"
		}
	];

	const [registerTable] = useTable({
		dataSource: [
			{
				patientId: "3123awsdad",
				fullName: "Jack",
				birthday: "2025-01-23",
				gender: "male",
				patType: "1",
				patCardno: "55555",
				age: 23,
				address: "13wdfawfafa",
				occupation: "dawd",
				ethnicity: "gkw"
			}
		],
		columns: columns,
		formConfig: {
			labelWidth: 120,
			schemas: searchFormSchema,
			showActionButtonGroup: true,
			baseColProps: { span: 6 }
		},
		useSearchForm: true
	});

	return (
		<div className="page51301">
			<div className="page-content">
				<BasicTable register={registerTable}></BasicTable>
			</div>
		</div>
	);
}
